UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8RmGuNeRlB+iERJatAc+cVxVMSQLbm1JGmpvCkIwtC0=' 
WHERE 
  key_id = 'd63000aee846da6628dcf8ca6befef10c78443cac42e037c674dc9006c459861' 
  AND (
    token = '8RmGuNeRlB+iERJatAc+cVxVMSQLbm1JGmpvCkIwtC0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076