UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aOgobl3Fya9gvL/n4jgrZXDIFZTkjNVct3hjzIeLZ9E='
WHERE
key_id = 'ca76303c9dc612c57609453aa31e23d3fc0d2a67a52ed3960644914ffb142ee7'
AND (
token = 'aOgobl3Fya9gvL/n4jgrZXDIFZTkjNVct3hjzIeLZ9E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)