UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pOFel/RgcDkzUW1Hi3m2ReQkzhIcAwWikU9DSaRycdQ=' 
WHERE 
  key_id = '7fd629c0cd4da5fef557e2562d5dd96d90a72162f394a53e68e7592f9000737c' 
  AND (
    token = 'pOFel/RgcDkzUW1Hi3m2ReQkzhIcAwWikU9DSaRycdQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019