UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WjEQqvv3Hvtw3QOOqnrNuNUV/OOzGHPeCYWISnMJVEM=' 
WHERE 
  key_id = 'c606f6cc0ad20f1b254c5aa3601b3f75bc10521112c0b25119ee4fb21199b73c' 
  AND (
    token = 'WjEQqvv3Hvtw3QOOqnrNuNUV/OOzGHPeCYWISnMJVEM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024