UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fW7KMlmgeq9z/kYNMgwZroiwkQikL2c4eEnTvPYfibs='
WHERE
key_id = '3a41ed3d1d4e371edbd5a9d117afd6c71d0c8c5a77cd36cbcdb34d5c753f1b9e'
AND (
token = 'fW7KMlmgeq9z/kYNMgwZroiwkQikL2c4eEnTvPYfibs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)