UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iKfnP24wYqOMaSXoAWHb8ogdxysvCniJvQW+2tOL5mk='
WHERE
key_id = '067c00fad9630dfa8aacb9349f9fc99def5c078308feb2d7a07d48fb3532485a'
AND (
token = 'iKfnP24wYqOMaSXoAWHb8ogdxysvCniJvQW+2tOL5mk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)