UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4EGf42BFHvHN8eTMJys9e3noetc9xREIi5tRlgm+8p8=' 
WHERE 
  key_id = '1eb84f720b157af252d1abebc3a03478e9b05c2fcf2439f60aa4ee3571c56c86' 
  AND (
    token = '4EGf42BFHvHN8eTMJys9e3noetc9xREIi5tRlgm+8p8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036