UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DPd+/GSMJlCgjsGkgYXXUR7VjJ2yK0pr2YE7QGP4GXw='
WHERE
key_id = 'b6004c7127e39eed5dc16b65cec6b60795519a03525d50b527e4be50cc64668b'
AND (
token = 'DPd+/GSMJlCgjsGkgYXXUR7VjJ2yK0pr2YE7QGP4GXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)