UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HkBiqPvObuPZYAxtgsieJ4aPM0o3HrR6Ky/1xk72ibY=' 
WHERE 
  key_id = 'c8d9fcc3873063f185b0e9031098a3fe93b28f8af1cd4550ac4b9ac584220a9e' 
  AND (
    token = 'HkBiqPvObuPZYAxtgsieJ4aPM0o3HrR6Ky/1xk72ibY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016