UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q3KYtd0VUcJzycXDgvHt4xOADlB/nAT+zhQAiIcF4EI=' 
WHERE 
  key_id = '08f7355c647c7dc69e5a0cdb236e864ff3253a37ca4176b85adfd4e31fe602d3' 
  AND (
    token = 'Q3KYtd0VUcJzycXDgvHt4xOADlB/nAT+zhQAiIcF4EI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038