UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L2JmQva5N6yFtqzOX452U/dKOAZnPTqUo5eS8hB6l8M='
WHERE
key_id = 'c4fb572b0f6ae5dc85730007c1566f14c12734076d9974d5b962395377294862'
AND (
token = 'L2JmQva5N6yFtqzOX452U/dKOAZnPTqUo5eS8hB6l8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)