UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0w5Nb1+iagiQ5tKV+3Synk2FZfwtoxu8tPBV8qV04vk=' 
WHERE 
  key_id = '1e456a10b4f6e4963dcabf466f2f218ca052a30cd5c1ba174a26cd6bb48c34ef' 
  AND (
    token = '0w5Nb1+iagiQ5tKV+3Synk2FZfwtoxu8tPBV8qV04vk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017