UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RR96tbpdtAQNRqZ+YtMikban7YEuYAjjdohtvp7xjEQ=' 
WHERE 
  key_id = 'a80be25838e0c54a3d935831bac15f8f57c8f3fa0f3d09f7cb4b1376bb077a45' 
  AND (
    token = 'RR96tbpdtAQNRqZ+YtMikban7YEuYAjjdohtvp7xjEQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057