UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8LLpYsBG/2+gsYBV/hMljTVEwKQy+Q4hZeTwCYdUbQ0='
WHERE
key_id = 'd6e56eb8e5c2975a698c3eada853de6b1ed2e1d2fc9e1ee281c0edd690b56519'
AND (
token = '8LLpYsBG/2+gsYBV/hMljTVEwKQy+Q4hZeTwCYdUbQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)