UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DnnMxKGfRotuY/1d6wzNQHi8NAv9cK0QW1EdO6tYxDA='
WHERE
key_id = 'e6946ca08a7fe3744d3e47e3b1ba77f7c2fe9935d967954662d3ccf2b24aff4a'
AND (
token = 'DnnMxKGfRotuY/1d6wzNQHi8NAv9cK0QW1EdO6tYxDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)