UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P7dR4bVEskXqAr55G8HuHTistAAU/y9alvl3F5fErLY='
WHERE
key_id = '0f699e9f8f11bba248812c6da5e7bf0fcbf237c461bdd332ef6dd487f5410f8c'
AND (
token = 'P7dR4bVEskXqAr55G8HuHTistAAU/y9alvl3F5fErLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)