UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hn+SjSwj4sW4WIbwJksV0v3JImkrxcy8t9CrY2v7mxs='
WHERE
key_id = '692f723f842f8d9c2ad3ab6783ea688529444838f6ea6cf8a7865b3d0e7cd84c'
AND (
token = 'hn+SjSwj4sW4WIbwJksV0v3JImkrxcy8t9CrY2v7mxs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)