UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qww3lzWbsX7unurkHPjUNtWFPk9oBIc+oZGPHe/TUD0='
WHERE
key_id = '94d25195d9a77867cee026d1b3559b6c4243c0506959dc017fd9ad2861b12f4a'
AND (
token = 'Qww3lzWbsX7unurkHPjUNtWFPk9oBIc+oZGPHe/TUD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)