UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Td1IzA0JT0TbN0coW5rMxTlTfz8obRuM2zged7ywOQ='
WHERE
key_id = 'dee42a420f48008642d35fb1b6e28075c34458102d31e00bc5a60ae543d70fc1'
AND (
token = '8Td1IzA0JT0TbN0coW5rMxTlTfz8obRuM2zged7ywOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)