UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4AN+UB02xVwO36nbY08bXSQaVUFxQsF96LB0brSb6IA='
WHERE
key_id = '6d59668f09b9d19254ab2fd202fd08b84a6161197ebe912ed49b056015ea4bc4'
AND (
token = '4AN+UB02xVwO36nbY08bXSQaVUFxQsF96LB0brSb6IA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)