UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mkB4cIwAP7jHfW3eWcirgAAxsh/4DftbUC+kGgdwick=' 
WHERE 
  key_id = '17f93ef871fbf0e632f0a4f7944e73d0c336b5693261de4115ac85e06a2c3329' 
  AND (
    token = 'mkB4cIwAP7jHfW3eWcirgAAxsh/4DftbUC+kGgdwick=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028