UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kLXo51tw/Yy8Q2N9CoA7xp2MrTR9qIPDCNN7nwSXXCQ='
WHERE
key_id = '6b1ae89327ac6f670e1dedf9321a908dcc336ea4b08845b662357e1af754ba8d'
AND (
token = 'kLXo51tw/Yy8Q2N9CoA7xp2MrTR9qIPDCNN7nwSXXCQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)