UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1p8mMQMtJMXyRHcdkp20G+T4+hw+tTvHrq7uO35jxEU=' 
WHERE 
  key_id = 'e45724f52afc8680bd2cdb4de756ca88ac0e58bba54d577c27ef9a565c717a51' 
  AND (
    token = '1p8mMQMtJMXyRHcdkp20G+T4+hw+tTvHrq7uO35jxEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038