UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '06fPMv4t8a6X6bF3zIucet+Ctvf2eCBg2cc9bPDGqaA=' 
WHERE 
  key_id = 'af57c4aa7748f8a77e8330a1c75174979af096860469d4240e8c7dde9ce2cd66' 
  AND (
    token = '06fPMv4t8a6X6bF3zIucet+Ctvf2eCBg2cc9bPDGqaA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034