UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'as1TFXD6XySpFbwmbiWGmY/xTaGWZTnicGMnZjR0rsY='
WHERE
key_id = '6e81a353d7875f0d98630bed737034a283f905a5bb865ef0fbf489870d534ac8'
AND (
token = 'as1TFXD6XySpFbwmbiWGmY/xTaGWZTnicGMnZjR0rsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)