UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sgMvRBwG+RsfcJg9/S3cZF38E1lgFJUXFo0ZdWOtM/Y='
WHERE
key_id = 'cee454ad779de5d652799d643f12e6c05a9a2fbbce43a3e19b86a29a5ba2802f'
AND (
token = 'sgMvRBwG+RsfcJg9/S3cZF38E1lgFJUXFo0ZdWOtM/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)