UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eMfN+JstJRAHQJC3dKHOrj5cILoP9rdLp+wx620Rojk='
WHERE
key_id = 'd2ee0e7c17d771d561a9966bfdb8bb036bbae5aead2ab02de0cc8a7e36d74be8'
AND (
token = 'eMfN+JstJRAHQJC3dKHOrj5cILoP9rdLp+wx620Rojk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)