UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y/aLT9CPTQrWmDRvDvSQ6v2SBONRD9M/TXoPkVo6WnE=' 
WHERE 
  key_id = '25e599b6cb47048f89a693864fea38f8094d255505fcd4d30ca547d6651180e6' 
  AND (
    token = 'Y/aLT9CPTQrWmDRvDvSQ6v2SBONRD9M/TXoPkVo6WnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044