UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zKQMNI6g2cjDpk0wfLW2RHVU81laVJaNRPDqnyelvHs=' 
WHERE 
  key_id = '53d1b57a7f6f9f2ffeae81fe62b91186ba52c826a4b6737d36a463b7b5b9a816' 
  AND (
    token = 'zKQMNI6g2cjDpk0wfLW2RHVU81laVJaNRPDqnyelvHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015