UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NfxPY5aQbZnj457Eps+MoxxHCuNtj2qjLytK/t8qhiQ='
WHERE
key_id = 'fea8b8de1c82efe3275ffed289fe44680d7b996134d6b7f065a894544ba0c807'
AND (
token = 'NfxPY5aQbZnj457Eps+MoxxHCuNtj2qjLytK/t8qhiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)