UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ctxIo3dGCha3Bu5Q2banKytW1OTgHEMSAvM4ZyMD1pA=' 
WHERE 
  key_id = '48198f56a6d429de60520993f2355f01513e5917b02470aaa2aaa2670ed164e0' 
  AND (
    token = 'ctxIo3dGCha3Bu5Q2banKytW1OTgHEMSAvM4ZyMD1pA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035