UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uMwE+2yOSe3j08casdRt4AcfM9LMp44VatKP/Jye78I='
WHERE
key_id = 'e5143a3e6751adb2ff8f6d1d94c51cf084ce90cebe808e4b60aef877f39bad98'
AND (
token = 'uMwE+2yOSe3j08casdRt4AcfM9LMp44VatKP/Jye78I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)