UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XFNn/jLIAp0peldbHnF9859K7FgBNfnfvs0QnTWTpSw='
WHERE
key_id = 'dcce84a0da23602e42b2e2f3d83f61774ced6054cbf8ed37c3024c92ae5e0abe'
AND (
token = 'XFNn/jLIAp0peldbHnF9859K7FgBNfnfvs0QnTWTpSw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)