UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cyEce75qGwZfogKQSAnz13M6609Q+ccppAuQnNJJM6o=' 
WHERE 
  key_id = '9d2c7b8fc3f1774cb7bbbea637cc24447cea53e262370a15f4334ee322d1568b' 
  AND (
    token = 'cyEce75qGwZfogKQSAnz13M6609Q+ccppAuQnNJJM6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038