UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MDK1aGv4Z+CtwqI3qk8vqJDJh8ZJc3Uf4Af/QuJSDIE=' 
WHERE 
  key_id = 'adb92a56d20036918df5249efe2d060f49efd97662345b3adbdd9c60a860419a' 
  AND (
    token = 'MDK1aGv4Z+CtwqI3qk8vqJDJh8ZJc3Uf4Af/QuJSDIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037