UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E03y3CSxG2KwfD2dNmBWU5HxTVEUTa0SArSklbyOtys='
WHERE
key_id = '8589c614b0c74d1685fde25f1e1c754251c5a097dc6e8e8487d9bf8e87710ddf'
AND (
token = 'E03y3CSxG2KwfD2dNmBWU5HxTVEUTa0SArSklbyOtys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)