UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4yN28Ty1u3U8eUWdbd4Ju9znl1T8I3ZyVd3Aqkk1ibk='
WHERE
key_id = 'e0bcc0d4842c3acc05ad959e48f7c631b872eda19460c3b3f058318eb17ed9c5'
AND (
token = '4yN28Ty1u3U8eUWdbd4Ju9znl1T8I3ZyVd3Aqkk1ibk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)