UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rlW+R7Y5YGP3WZYXYGpX6fm0gY1QfkcIHHL+da/KfAA=' 
WHERE 
  key_id = 'cd48ae153d7fb0b40d8a7794009b7eeb691e0be1ef5bc53e8f7a1f6005c0c978' 
  AND (
    token = 'rlW+R7Y5YGP3WZYXYGpX6fm0gY1QfkcIHHL+da/KfAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063