UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cw2KckYbZqw4SSflhkJc7uYWCNH1Cx/zvtJOQfC2Kj0='
WHERE
key_id = '95d0338388ff6d5bbb03812ccf391ad06d5b50acd7ade3442d08cc19501cebe8'
AND (
token = 'cw2KckYbZqw4SSflhkJc7uYWCNH1Cx/zvtJOQfC2Kj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)