UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mMmAcxManJjonuEceYe65iCbKvQFrx/KyPGVtciJPzM='
WHERE
key_id = 'fe94a740264ac9534313bb1ff615d2adb71683cf33273a43c0784344d7d54bf9'
AND (
token = 'mMmAcxManJjonuEceYe65iCbKvQFrx/KyPGVtciJPzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)