UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QkLmq63FeUAwhGrnEsNWQZfLADnUZdNQjdX/CNvKHsw='
WHERE
key_id = '84a8ca8ffb6e3d717f66c2d694a298f97e859e2a33d38f20c315b78519b60081'
AND (
token = 'QkLmq63FeUAwhGrnEsNWQZfLADnUZdNQjdX/CNvKHsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)