UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yYCeomHsokZJp4jXZ0dfQyAK6T/ZdRIo414Q9dErztM=' 
WHERE 
  key_id = 'a3f7ae452c9b0612c59b8369ff82cae974e9b8c26c9d18bf15fd17e04ae651b4' 
  AND (
    token = 'yYCeomHsokZJp4jXZ0dfQyAK6T/ZdRIo414Q9dErztM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027