UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cbJ/mao8LHg3cSR8AFbwrynzzYJWvxxymbDb6pt/m2c=' 
WHERE 
  key_id = '56356870ee4aeacbcc5113e7161f146a9d732e5b710ac49e749d19981de80486' 
  AND (
    token = 'cbJ/mao8LHg3cSR8AFbwrynzzYJWvxxymbDb6pt/m2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042